//
//  CustomUIView.m
//  UI05_homework_OA
//
//  Created by aaaaaa on 16/6/12.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CustomUIView.h"

@implementation CustomUIView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    self.backgroundColor = [UIColor colorWithRed:arc4random() % 256 / 255.0 green:arc4random() % 256 / 255.0 blue:arc4random() % 256 / 255.0 alpha:1.0];
}

- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, arc4random() % (100 + 1) - 20, arc4random() % (100 + 1) - 20);
}

@end
